﻿CREATE PROCEDURE [dbo].[yaf_nntpforum_save](
                @NntpForumID  INT  = NULL,
                @NntpServerID INT,
                @GroupName    NVARCHAR(100),
                @ForumID      INT,
                @Active       BIT)
AS
    BEGIN
        IF @NntpForumID IS NULL
        INSERT INTO yaf_NntpForum
                   (NntpServerID,
                    GroupName,
                    ForumID,
                    LastMessageNo,
                    LastUpdate,
                    Active)
        VALUES     (@NntpServerID,
                    @GroupName,
                    @ForumID,
                    0,
                    Getdate(),
                    @Active)
        ELSE
        UPDATE yaf_NntpForum
        SET    NntpServerID = @NntpServerID,
               GroupName = @GroupName,
               ForumID = @ForumID,
               Active = @Active
        WHERE  NntpForumID = @NntpForumID
    END


